<html>
<head><meta charset="utf-8"><title>Compiler error when using itertools .powerset().flatten() · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Compiler.20error.20when.20using.20itertools.20.2Epowerset().2Eflatten().html">Compiler error when using itertools .powerset().flatten()</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="241789329"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Compiler%20error%20when%20using%20itertools%20.powerset%28%29.flatten%28%29/near/241789329" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Odd-Harald Myhren <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Compiler.20error.20when.20using.20itertools.20.2Epowerset().2Eflatten().html#241789329">(Jun 07 2021 at 14:58)</a>:</h4>
<p>With the following code:</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">use</span><span class="w"> </span><span class="n">itertools</span>::<span class="n">Itertools</span><span class="p">;</span><span class="w"></span>

<span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">set</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">[</span><span class="mi">1</span><span class="p">,</span><span class="w"> </span><span class="mi">2</span><span class="p">,</span><span class="w"> </span><span class="mi">3</span><span class="p">];</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="n">powerset</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">set</span><span class="p">.</span><span class="n">iter</span><span class="p">().</span><span class="n">powerset</span><span class="p">().</span><span class="n">flatten</span><span class="p">().</span><span class="n">collect_vec</span><span class="p">();</span><span class="w"></span>
<span class="w">    </span><span class="fm">dbg!</span><span class="p">(</span><span class="o">&amp;</span><span class="n">powerset</span><span class="p">);</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<p>where <code>Cargo.toml</code> looks like following:</p>
<div class="codehilite" data-code-language="TOML"><pre><span></span><code><span class="k">[package]</span>
<span class="n">name</span> <span class="o">=</span> <span class="s">"another"</span>
<span class="n">version</span> <span class="o">=</span> <span class="s">"0.1.0"</span>
<span class="n">authors</span> <span class="o">=</span> <span class="k">["Knarkzel &lt;knarkzel@gmail.com&gt;"]</span>
<span class="n">edition</span> <span class="o">=</span> <span class="s">"2018"</span>

<span class="k">[dependencies]</span>
<span class="n">itertools</span> <span class="o">=</span> <span class="s">"0.10.0"</span>
</code></pre></div>
<p>On <code>rustc 1.53.0-nightly (f82664191 2021-03-21) running on x86_64-unknown-linux-gnu</code> I get the following internal compiler error:</p>
<div class="codehilite" data-code-language="Bash"><pre><span></span><code>   Compiling another v0.1.0 <span class="o">(</span>/home/odd/source/rust/another<span class="o">)</span>
thread <span class="s1">'rustc'</span> panicked at <span class="s1">'found unstable fingerprints for evaluate_obligation(9ae8f7968c2251b-5920aadb538740cc): Ok(EvaluatedToOk)'</span>, /rustc
/f82664191d0e8764b7435b9d72eb0e366b8b1464/compiler/rustc_query_system/src/query/plumbing.rs:593:5
note: run with <span class="sb">`</span><span class="nv">RUST_BACKTRACE</span><span class="o">=</span><span class="m">1</span><span class="sb">`</span> environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels<span class="o">=</span>C-bug%2C+I-ICE%2C+T-compiler<span class="p">&amp;</span><span class="nv">template</span><span class="o">=</span>ice.md

note: rustc <span class="m">1</span>.53.0-nightly <span class="o">(</span>f82664191 <span class="m">2021</span>-03-21<span class="o">)</span> running on x86_64-unknown-linux-gnu

note: compiler flags: -Z share-generics<span class="o">=</span>y -C embed-bitcode<span class="o">=</span>no -C <span class="nv">debuginfo</span><span class="o">=</span><span class="m">2</span> -C <span class="nv">linker</span><span class="o">=</span>/usr/bin/clang -C incremental -C link-arg<span class="o">=</span>-fuse-ld<span class="o">=</span>lld
 -C target-cpu<span class="o">=</span>native --crate-type bin

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
<span class="c1">#0 [evaluate_obligation] evaluating trait selection obligation `itertools::Powerset&lt;std::slice::Iter&lt;i32&gt;&gt;: std::marker::Freeze`</span>
<span class="c1">#1 [is_freeze_raw] computing whether `itertools::Powerset&lt;std::slice::Iter&lt;i32&gt;&gt;` is freeze</span>
end of query stack
error: could not compile <span class="sb">`</span>another<span class="sb">`</span>

To learn more, run the <span class="nb">command</span> again with --verbose.
</code></pre></div>



<a name="241793676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Compiler%20error%20when%20using%20itertools%20.powerset%28%29.flatten%28%29/near/241793676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lqd <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Compiler.20error.20when.20using.20itertools.20.2Epowerset().2Eflatten().html#241793676">(Jun 07 2021 at 15:24)</a>:</h4>
<p>this specific error is an incremental issue that generally falls under <a href="https://github.com/rust-lang/rust/issues/84970">#84970</a>. However, many of those have already been fixed in more recent nightlies. if you could try updating your nightly and keeping us updated if this error still reproduces, that would be helpful</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>